<script setup>
defineProps({
  name: String,
  picture: String,
  price: String
})
</script>

<template>
  <div class="goods-item">
    <img v-lazyImg="picture" alt="" />
    <div class="goods-item-info">
      {{ name }}
    </div>
    <div class="goods-item-price">
      ￥{{ price }}
    </div>
  </div>
</template>

<style lang="scss" scoped>
.goods-item {
  width: 160px;
  height: 230px;
  padding: 30px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  img {
    width: 160px;
    height: 160px;
  }
  .goods-item-info {
    width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .goods-item-price {
    font-size: 20px;
    color: #cf4444;
  }
  &:hover {
    transform: translate3d(0, -3px, 0);
    box-shadow: 0 3px 8px rgb(0 0 0 / 20%);
  }
}
</style>
